﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Model;

namespace BookManage
{
    public partial class frmAddUser : Form
    {
        public BookUser user = null;
        public frmAddUser()
        {
            InitializeComponent();
        }

        private void txtUserPwd_TextChanged(object sender, EventArgs e)
        {

        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            user = new BookUser();
            user.UserName = txtUserName.Text;
            user.UserPwd = txtUserPwd.Text;
            if (txtUserPwdConfirm.Text != user.UserPwd)
            {
                MessageBox.Show("密码不一致请重新填写！", "系统提示");
                this.DialogResult = DialogResult.Cancel;
                this.Close();
                return;
            }
                this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
